
#ifndef myVector3D_H
#define myVector3D_H

	#include <math.h>
	#include <iostream>

	class myVector3D
	{
	  //The dx,dy,dz of this vector.
	public:
	  double dX, dY, dZ; 
  
	  myVector3D() {}

	  myVector3D(double dx, double dy, double dz)
	  {
		dX = dx;
		dY = dy;
		dZ = dz;
	  }

	  double operator*(myVector3D & v1)
	  {
		return (v1.dX*dX + v1.dY*dY + v1.dZ*dZ);
	  }

	  myVector3D operator+(myVector3D & v1)
	  {
		return myVector3D(v1.dX+dX, v1.dY+dY, v1.dZ+dZ);
	  }

	  myVector3D operator*(double d)
	  {
		return myVector3D(dX*d, dY*d, dZ*d);
	  }

	  double length( )
	  {
		return sqrt( dX*dX + dY*dY + dZ*dZ ); 
	  }

	  void normalize( )
	  {
		double l = length();
		dX = dX/l;
		dY = dY/l;
		dZ = dZ/l;
	  }

	  void print(char *s)
	  {
		  std::cout << s << dX << ", " << dY << ", " << dZ << "\n";
	  }
	};

#endif